#!/bin/bash

# for file in `find templates -name "*.tpl"`; do
#   if [ $file -nt ${file}c ]; then
#     tsmarty2c $file > ${file}c
#   fi
# done

touch messages.po
find . -type f -name "*.\(php\|tplc\)" | xgettext -j -f -
if [ -f local/messages.po ]; then
  msgmerge -N local/messages.po messages.po>new.po
  mv new.po local/messages.po
  rm -f messages.po
else
  mv messages.po local/messages.po
fi
